export default function (req, res, next) {
  try {
    decodeURI(req.url);
    next();
  } catch (error) {
    console.log(`[invalid uri] ${req.url}`);
    // 针对非法的URi，重定向到首页
    res.writeHead(302, {
      Location: '/'
    });
    res.end();
  }
}
